function getVolumen(pDAP,pHC,factor){

	var result=-1.0;	
			
    switch (factor) { 
        case "1":
            result = (0.000248*(Math.pow(pDAP, 1.81847)))*(Math.pow(pHC,0.64862));
            break;
        case "2":
            result = (0.000171* (Math.pow(pDAP, 1.95698))) * (Math.pow(pHC, 0.63653));
            break;
        case "3":
            result = (0.000166 * (Math.pow(pDAP, 1.82571))) * (Math.pow(pHC, 0.95281));
            break;
        case "4":
			var log1=getLog(pDAP);
			var log2=getLog(pHC);
					
            result = (2.03986 * log1) + ((0.779 * log2) - 4.07682);
			result=Math.pow(10,result);
            break;
                
    }
			
	result=result.toFixed(5);
	return result;
			
}
		
		
function getLog(valor){
		
	var log1 = valor;
	var base1 =10;
	var dn=1;
	dn=Math.log(base1);
	var ans=Math.log(log1)/dn;
	return ans;
}



function getAreaBasal(pDAP, pHC, factor) {
    //pDap en centimetros
    //pHc en metros
    result = -1.5;

    //El pDap viene en centimetros por ello se convierte a metros
    result = ((Math.pow((pDAP / 2), 2)) * Math.PI) / 10000;

    //Redondear a dos decimales
    result = result.toFixed(6);

    return result;
}